package edu.tju.moralManage;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.younker.waf.db.IBatisConfig;

public class IbatisAppraiseResultDao implements IAppraiseResultDao{
	
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();


	public List<AppraiseResult> getAppraiseResultAnd(AppraiseResult appraiseResult) throws SQLException {
	
		return sqlMap.queryForList("getAppraiseResultAnd", appraiseResult);
	}

	public AppraiseResult getAppraiseResultById(long id) throws SQLException {
	
		return (AppraiseResult) sqlMap.queryForObject("getAppraiseResultById", id);
	}

	public List<AppraiseResult> getAppraiseResultOr(
			AppraiseResult appraiseResult) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Long insertAppraiseResult(AppraiseResult appraiseResult)
			throws SQLException {
		
		return (Long)sqlMap.insert("insertAppraiseResult", appraiseResult);
	}

	public int updateAppraiseResult(AppraiseResult appraiseResult)
			throws SQLException {
		
		return sqlMap.update("updateAppraiseResult", appraiseResult);
	}

	public void deleteAppraiseResult(long id) throws SQLException {
		sqlMap.delete("deleteAppraiseResult", id);
		
	}

}
